classdef GR_Line
    properties
        Width {mustBeNumeric}
        Style
        Color
        Marker
        MarkerSize
        MarkerFaceColor
    end
    methods
        function obj=GR_Line(NameValueArgs)
            arguments
                NameValueArgs.Width double      =   1;
                NameValueArgs.Style char        =   '-';
                NameValueArgs.Color             =   MyColor();
                NameValueArgs.Marker            =   'none';
                NameValueArgs.MarkerSize        =   3;
                NameValueArgs.MarkerFaceColor   =   'none';
            end
            obj.Width       =   NameValueArgs.Width;
            obj.Style       =   NameValueArgs.Style;
            obj.Color       =   NameValueArgs.Color;
            obj.Marker      =   NameValueArgs.Marker;
            obj.MarkerSize  =   NameValueArgs.MarkerSize;
            obj.MarkerFaceColor=NameValueArgs.MarkerFaceColor;
        end
        function ph=Plot(obj,varargin)
            switch length(varargin)
                case 2
                    ph  =   plot(varargin{1},varargin{2},...
                                 'LineWidth',obj.Width,'LineStyle',obj.Style,...
                                 'Color',obj.Color,...
                                 'Marker',obj.Marker,'MarkerSize',obj.MarkerSize,...
                                 'MarkerFaceColor',obj.MarkerFaceColor);
                case 3
                    ph  =   plot(varargin{1},varargin{2},varargin{3},...
                                 'LineWidth',obj.Width,'LineStyle',obj.Style,...
                                 'Color',obj.Color,...
                                 'Marker',obj.Marker,'MarkerSize',obj.MarkerSize,...
                                 'MarkerFaceColor',obj.MarkerFaceColor);
            end
            
        end
    end
end